﻿using Abp.Application.Services.Dto;
using SingleUserMall.Common;
using SingleUserMall.Orders.VO;
using SingleUserMall.ShoppingCarts.Form;
using SingleUserMall.ShoppingCarts.VO;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SingleUserMall.ShoppingCarts
{
    /// <summary>
    /// 购物车
    /// </summary>
    [Description("购物车")]
    public interface IShoppingCartAppService : IAppService
    {
        /// <summary>
        /// 加入购物车
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task AddShoppingCartItemAsync(ShoppingCartItemForm form);
        /// <summary>
        /// 获取购物车元素数量
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<int> GetShoppingCartCountAsync(MayHasStoreForm form);
        /// <summary>
        /// 获取购物车信息
        /// </summary>
        /// <returns></returns>
        Task<ListResultDto<ShoppingCartItemByStoreVO>> GetShoppingCartAsync(MayHasStoreForm form);
        /// <summary>
        /// 设置购物车商品数量
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task EditShoppingCartItemAsync(ShoppingCartForm form);
        /// <summary>
        /// 移除购物车元素
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task RemoveShoppingCartItemsAsync(ShoppingCartItemsForm form);
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> SettleAsync(ShoppingCartItemsForm form);
        /// <summary>
        /// 立即购买
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> BuyAsync(ShoppingCartItemForm form);

        /// <summary>
        /// 创建拼单
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> GroupBuyAsync(GroupBuyItemForm form);
        /// <summary>
        /// 加入拼单
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> PartinGroupBuyAsync(PartinGroupBuyItemForm form);
        /// <summary>
        /// 立即抢购
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> RushBuyAsync(ShoppingCartItemForm form);
        /// <summary>
        /// 砍价成功后购买
        /// </summary>
        /// <param name="form"></param>
        /// <returns></returns>
        Task<OrderVO> BargainBuyAsync(ShoppingCartItemForm form);
    }
}
